<template>
	<view class="mord">
		<view class="main">
			<view class="h1">
				邀请好友得分红奖励，多邀多得!
			</view>
			<view class="p">
				<!-- 邀请好友扫描二维码，TA可获得首单专属优惠，你可获得订单实付金额的5%作为奖励活动规则> -->
			</view>
			<view class="ku">
				<image src="../../static/img/3/3-91.png" class="title" mode="widthFix"></image>
				<!-- <image class="er" :src="url" mode="widthFix"></image> -->
				<canvas canvas-id="qrcode" style="width: 354px;height: 354px;margin-top: 30px;" />
				<view class="text">
					<!-- 长按识别二维码，<text>领20元</text>直减券或<text>85折</text>折扣券 -->
				</view>
			</view>
			<view class="button">
				保存并分享图片

			</view>
		</view>
	</view>
</template>

<script>
	import uQRCode from '@/common/uqrcode.js'
	export default {
		name: "",
		components: {

		},
		data() {
			return {
				url:''
			}
		},
		onLoad() {
			this.getData()
		},
		methods: {

			getData(){
				// let data = {
				// 	mobile:this.$SysCache.get("userInfo").cPhone,
				// 	url:'http://youyou.tangmu.xin/#/'
				// }
				// this.$Request.post4(
				// 	this.$api.httpApi.user.shareUrl, data
				// ).then(res => {
				// 	if (res.code == 1) {
				// 		this.url = res.data.url
				// 		 uQRCode.make({
				// 		         canvasId: 'qrcode',
				// 		         componentInstance: this,
				// 		         text: res.data.url,
				// 		         size: 290,
				// 		         margin: 10,
				// 		         backgroundColor: '#ffffff',
				// 		         foregroundColor: '#000000',
				// 		         fileType: 'jpg',
				// 		         correctLevel: uQRCode.errorCorrectLevel.H,
				// 		         success: res => {
				// 		           console.log(res)
				// 		         }
				// 		       })
				// 	}
				// })
				uQRCode.make({
				        canvasId: 'qrcode',
				        componentInstance: this,
				        text: "https://vip.inja.com/#/pages/login/next?recommender="+this.$SysCache.get('userInfo').cPhone || this.$SysCache.get('userInfo').phone,
				        size: 290,
				        margin: 10,
				        backgroundColor: '#ffffff',
				        foregroundColor: '#000000',
				        fileType: 'jpg',
				        correctLevel: uQRCode.errorCorrectLevel.H,
				        success: res => {
				          console.log(res)
				        }
				      })
				
			}
		
		}
		

	}
</script>

<style scoped>
	uni-page-body{
		height: 100%;
	}
	.mord{
		min-height: 100%;
		background: #EEEEEE;
		padding-top: 76rpx;
	}
	.main{
		width: 602rpx;
		margin: auto;
	}
	.h1{
		text-align: center;
		font-size:36rpx;
		font-family:Microsoft YaHei;
		font-weight:400;
		color:rgba(51,51,51,1);
	}
	.p{
		font-size:24rpx;
		font-family:Microsoft YaHei;
		font-weight:400;
		color:rgba(102,102,102,1);
		line-height:40rpx;
		text-align: center;
		margin-top: 22rpx;
	}
	.ku{
		padding: 40rpx;
		background: #fff;
		margin-top: 60rpx;
	}
	.ku .title{
		display: block;
		margin: auto;
		width: 333rpx;
	}
	.ku .er{
		display: block;
		width: 100%;
		margin: auto;
		margin-top: 38rpx;
	}
	.text{
		font-size:22rpx;
		font-family:Microsoft YaHei;
		font-weight:400;
		color:rgba(68,68,68,1);
		width: 448rpx;
		margin: auto;
		margin-top: 22rpx;
	}
	.text text{
		color: #F0406F;
	}
	.button{
		width:602rpx;
		height:92rpx;
		background:rgba(240,64,111,1);
		margin-top: 28rpx;
		font-size:24rpx;
		font-family:Microsoft YaHei;
		font-weight:400;
		color:rgba(255,255,255,1);
		text-align: center;
		line-height: 92rpx;
	}
</style>
